package com.gitee.pifeng.monitoring.ui.business.web.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.pifeng.monitoring.common.inf.ISuperBean;
import com.gitee.pifeng.monitoring.ui.business.web.entity.XjDataLink;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.Date;

@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@Builder
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "数链详情数据")
public class XjDataLinkDetailVo implements ISuperBean {

    private String dataLinkName;

    private String remark;

    private String fromNode;

    private String toNode;

    private Long dbId;

    private Long nodeX;

    private Long nodeY;

    private String linkColor;

    private String linkType;

    private String connName;

    private String dbDesc;

    private String url;

    private String username;

    private String dbType;

    private String driverClass;

    private String isOnline;

    private String offlineCount;

    private String monitorEnv;

    private String monitorGroup;

    private String text;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date insertTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    private ArrayList<XjDataLinkDetailVo> links;

    public XjDataLinkDetailVo convertFor(XjDataLink xjDataLink) {
        if (null != xjDataLink) {
            BeanUtils.copyProperties(xjDataLink, this);
        }
        return this;
    }

}
